import cv2
import numpy as np # NumPy（Numerical Python）是 Python 中非常重要的一个科学计算库。
img = cv2.imread("Resources/lena.png")
kernel = np.ones((5,5), np.uint8)

imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 灰色
imgBlur = cv2.GaussianBlur(imgGray, (7,7), 0) # 模糊
imgCanny = cv2.Canny(img, 100 , 100) # 线条处理
imgDialation = cv2.dilate(imgCanny,kernel, iterations=1) # 线条变粗
imgEroded = cv2.erode(imgDialation, kernel, iterations=1)

cv2.imshow("Gray Image", imgGray)
cv2.imshow("Blur Image", imgBlur)
cv2.imshow("Canny Image", imgCanny)
cv2.imshow("dilate Image", imgDialation)
cv2.imshow("Eroded Image", imgEroded)

cv2.waitKey(0)